<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head th:include="include :: header"></head>
<style>

    .layui-upload-colse {
        position: relative;
    }

    .closeUpload {
        position: absolute;
        top: 0;
        right: 0;
        width: 20px;
        height: 20px;
        cursor: pointer;
    }

    .upImg {
        width: 80px;
        height: 80px;
    }

    .formfixed {
        position: relative;
    }

    .remove {
        position: absolute;
        top: 125%;
        right: -175px;
        transform: translateY(-50%);
        cursor: pointer;
    }

    .myheader {
        height: 140px;
        background-color: #FFFFFF;
        padding: 20px 0;
        display: flex;
        align-items: center;
        margin: 0;
        flex-wrap: wrap;
    }

    .layui-tab {

        overflow: auto;
        background-color: #FFFFFF;
        margin: 10px 0 0 0;
    }

    .layui-input-block1 {
        display: flex;
        align-items: center;
        justify-content: flex-start
    }
    .layui-tab-title{
        height: 40px!important;
    }
    .layui-tab-content{
        height: calc(100% - 40px);
        overflow: auto;
    }
</style>
<body>
<input id="userId" th:value="${userId}" style="display: none">
<input id="isSubmit" th:value="${null!=myData && myData?.auditStatus!=0}" style="display: none">
<div class="layui-fluid mt2" style="background-color: #f0f2f5;padding: 0px!important">
    <form class="layui-form" style="height: 100%;">
        <div class="layui-form-item " style="background: #fff;  height: 60px;    padding-top: 10px;">
            <div class="layui-inline" style="width: calc((100% - 40px) / 3);">
                <label class="layui-form-label">发布人：</label>
                <div class="layui-input-block layui-input-block1" th:text="${myData?.userName}">
                </div>
            </div>
            <div class="layui-inline" style="width: calc((100% - 40px) / 3);">
                <label class="layui-form-label" >发布时间：</label>
                <div class="layui-input-block layui-input-block1" th:text="${myData.createTime} eq null ? '' : ${#dates.format(myData?.createTime, 'yyyy-MM-dd HH:mm:ss')}">
                </div>
            </div>
            <div class="layui-inline" style="width: calc((100% - 40px) / 3);">
                <label class="layui-form-label">审核状态：</label>
                <div class="layui-input-block layui-input-block1" th:text="${myData?.auditStatus==0?'待审核':'已审核'}">
                </div>
            </div>
        </div>

        <div class="layui-form-item " style="background: #fff;  height: 60px;display: flex; align-items: center; padding-left: 30px;   padding-top: 10px;margin: 0" >
          <h3>基本信息</h3>
        </div>

        <div class="layui-form-item " style="background: #fff;  height: 60px;   padding-top: 10px;margin: 0">
            <div class="layui-inline" style="width: calc((100% - 40px) / 3);">
                <label class="layui-form-label">标题：</label>
                <div class="layui-input-block layui-input-block1" th:text="${myData?.title}">
                </div>
            </div>
            <div class="layui-inline" style="width: calc((100% - 40px) / 3);">
                <label class="layui-form-label">工作类型：</label>
                <div class="layui-input-block layui-input-block1" th:text="${myData?.projectName}">
                </div>
            </div>
            <div class="layui-inline" style="width: calc((100% - 40px) / 3);">
                <label class="layui-form-label">性别：</label>
                <div class="layui-input-block layui-input-block1" th:text="${myData?.sex=='1'?'男':(myData?.sex=='2'?'女':'未知')}">
                </div>
            </div>
        </div>

        <div class="layui-form-item " style="background: #fff;  height: 60px;    padding-top: 10px;padding: 0;margin: 0" >
            <div class="layui-inline" style="width: calc((100% - 40px) / 3);">
                <label class="layui-form-label">是否驻家：</label>
                <div class="layui-input-block layui-input-block1" th:text="${myData?.residentHome=='0'?'是':'否'}">

                </div>
            </div>
            <div class="layui-inline" style="width: calc((100% - 40px) / 3);">
                <label class="layui-form-label">薪资待遇：</label>
                <div class="layui-input-block layui-input-block1" th:text="${myData?.salary}">
                </div>
            </div>
            <div class="layui-inline" style="width: calc((100% - 40px) / 3);">
                <label class="layui-form-label">工作日期：</label>
                <div class="layui-input-block layui-input-block1"
                     th:text="${myData.workDate} eq null ? (' 至 '+
                     (${myData.endDate} eq null ?'':${#dates.format(myData?.endDate, 'yyyy-MM-dd HH:mm:ss')})) :

                     (${#dates.format(myData?.workDate, 'yyyy-MM-dd HH:mm:ss')}) +' 至 ' +
                     (${myData.endDate} eq null ?'':${#dates.format(myData?.endDate, 'yyyy-MM-dd HH:mm:ss')})">
                </div>
            </div>
        </div>
<!--        <div class="layui-form-item " >-->
<!--            <label class="layui-form-label">优先级</label>-->
<!--            <div class="layui-input-block layui-input-block1" th:text="${myData?.level}">-->
<!--            </div>-->
<!--        </div>-->
        <div class="layui-form-item " style="background: #fff;  height: 60px;    padding-top: 10px;padding: 0;margin: 0"  >
                <label class="layui-form-label">工作地址：</label>
                <div class="layui-input-block layui-input-block1" th:text="${myData?.address}">

                </div>
        </div>
        <div class="layui-form-item " style="background: #fff;  height: 60px;    padding-top: 10px;padding: 0; margin:0 0 20px 0;"  >
            <label class="layui-form-label">备注：</label>
            <div class="layui-input-block layui-input-block1" th:text="${myData?.remark}">
            </div>
        </div>

        <div  class="layui-form-item " style="background: #fff;  height: 60px;display: flex; align-items: center; padding-left: 30px;   padding-top: 10px;margin: 0" >
            <h3>阿姨信息</h3>
        </div>
        <div  class="layui-form-item" style="background: #fff;  height: auto;     min-height: 100px;  padding-top: 10px;display: flex; align-items: center;  justify-content: center;">
            <table class="layui-hide" id="exampleTable" lay-filter="exampleTable"></table>
            <script th:inline="javascript">
                setTimeout(()=>{
                    layui.use(['table'], function () {
                        //table
                        var table = layui.table
                        // 创建渲染实例
                        table.render({
                            elem: '#exampleTable'
                            ,id:'exampleTable'
                            ,cellMinWidth: 80
                            , page: { //支持传入 laypage 组件的所有参数（某些参数除外，如：jump/elem） - 详见文档
                                layout: ['limit', 'count', 'prev', 'page', 'next', 'skip'] //自定义分页布局
                                , curr: 1 //设定初始在第 5 页
                                , groups: 5 //只显示 1 个连续页码
                                , limit : 5
                                , limits : [5,15,30,50,100,200]
                            }
                            ,defaultToolbar: false
                            ,cols: [[
                                {
                                    field : 'name',
                                    title : '姓名',
                                    align : 'center'
                                },
                                {
                                    field : 'inchPhoto',
                                    title : '照片',
                                    align : 'center',
                                    templet:(d)=>{
                                        return  d.inchPhoto==''||null==d.inchPhoto?'-':` <img width="40" height="40" onclick="photosClick()" src="${d?.inchPhoto}"/>`
                                    }
                                },
                                {
                                    field : 'mobile',
                                    title : '联系电话',
                                    align : 'center'
                                },
                                {
                                    field : 'sex',
                                    title : '性别',
                                    align : 'center',
                                    templet: function (d) {
                                        return `<span>${d.sex== '1' ? '男':'女'}</span>`
                                    }
                                },
                                {
                                    field: 'projectName',
                                    title: '服务类型',
                                    align: 'center',
                                    templet: function (d) {
                                        let str = '';
                                        let projectName = d.projectName;
                                        if ( projectName != null ){
                                            projectName = projectName.split('、');
                                            projectName.map(function (v,k){
                                                if( v != '' ){
                                                    if ( k <= 2) {
                                                        str += v+'、';
                                                    }
                                                }
                                            })
                                            str=str.substring(0,str.length-1)
                                            return `
							<span>${str}</span>
							`;
                                        }else{
                                            return '-';
                                        }
                                    }
                                },
                                {
                                    field : 'age',
                                    title : '年龄',
                                    align : 'center',
                                },
                                {
                                    field : 'education',
                                    title : '学历',
                                    align : 'center'
                                },
                                {
                                    field : 'workExperience',
                                    title : '工作经验',
                                    align : 'center'
                                },
                                {
                                    field : 'experience',
                                    title : '工作经历',
                                    align : 'center',
                                    templet:(d)=>{
                                        let myJson=JSON.parse(d.experience)
                                        let myFW10=''
                                        if(myJson.length>0){
                                            myFW10= myJson[0].describe
                                        }else{
                                            myFW10='-'
                                        }
                                        return `<span>${myFW10}</span>`
                                    }
                                },
                            ]]
                            ,data:[[${myData.userVOList}]]
                            ,done: function (res){
                                form.render()
                                hindLoading()
                            }
                        });
                    })
                },200)


            </script>
        </div>



        <div class="layui-form-item" style="background: #fff;padding: 0;  width: 100%;height: 150px">
            <label class="layui-form-label">审核结果：</label>
            <div  class="layui-form" th:if="${null==myData||myData.auditStatus == 0}">
                <input type="radio" lay-filter="demo-radio-filter" name="auditResult" value="0" title="通过" th:checked="${myData?.auditResult==0}">
                <input type="radio" lay-filter="demo-radio-filter" name="auditResult" value="1" title="拒绝" th:checked="${myData?.auditResult==1}" >
            </div>
            <div  class="layui-input-block layui-input-block1" th:if="${null!=myData && myData?.auditStatus!=0}"
                  th:text="${(myData?.auditResult==0)?'通过':((myData?.auditResult==1)?'拒绝':'未审核')}">
            </div>


            <div class="layui-input-block" th:style="${myData?.auditResult==1?'display: block':'display: none'}"  id="refuseReason">
                            <textarea name="refuseReason" placeholder="请输入拒绝原因" lay-verify="introduction"
                                      th:text="${myData?.refuseReason}"
                                      th:disabled="${myData?.auditStatus!=0}"
                                      class="layui-textarea"></textarea>
            </div>

        </div>




        <div class="layui-form-item  layui-flow-more">
            <div class="layui-inline">
                <button type="button" class="layui-btn" lay-submit lay-filter="submit"   th:text="${(null!=myData && myData?.auditResult!=2)?'确认':'立即提交'}"></button>
            </div>
        </div>

    </form>
</div>

<div th:include="include::footer"></div>
<script type="text/javascript" src="/js/xmSelect.js"></script>
<script type="text/javascript" src="/js/webJs/jzweb/jazUserDemand/info.js"></script>
</body>
</html>